/**
 * 
 */
package example.business.api.topic.services;

import java.io.File;
import java.util.List;
import java.util.Set;

import com.vanstone.fs.api.FileException;

import example.business.api.topic.Answer;
import example.business.api.topic.AnswerComment;
import example.business.api.topic.Question;
import example.business.api.topic.QuestionComment;

/**
 * @author shipeng
 *
 */
public interface TopicService {

  /**
   * 添加问题
   * 
   * @param content
   * @param remark
   * @param tagids
   * @return
   */
  Question addQuestion(String content, String remark, Set<String> tagnames, List<File> files) throws FileException;

  /**
   * 追加问题图片
   * 
   * @param questionID
   * @param file
   * @return
   * @throws FileException
   */
  Question appendQuestionImage(long questionID, File file) throws FileException;

  /**
   * 删除问题图片
   * 
   * @param questionID
   * @param fileid
   */
  void deleteQuestionImage(long questionID, String fileid);

  /**
   * 逻辑删除问题
   * 
   * @param questionID
   */
  void deleteQuestion(long questionID);

  /**
   * 获取问题详情
   * 
   * @param questionID
   * @return
   */
  Question getQuestion(long questionID);

  /**
   * 读取问题，点击量+1
   * 
   * @param questionID
   * @return
   */
  Question readQuestion(long questionID);

  /**
   * 获取问题列表
   * 
   * @param offset
   * @param limit
   * @return
   */
  List<Question> getQuestions(Boolean deleted, long offset, long limit);

  /**
   * 获取问题列表数量
   * 
   * @return
   */
  long getTotalQuestions(Boolean deleted);

  /**
   * 添加结果
   * 
   * @param questionID
   * @param answerContent
   * @return
   */
  Answer addAnswer(long questionID, String answerContent);

  /**
   * 获取结果信息
   * 
   * @param answerID
   * @return
   */
  Answer getAnswer(long answerID);

  /**
   * 获取结果列表
   * 
   * @param questionID
   * @param offset
   * @param limit
   * @return
   */
  List<Answer> getAnswers(long questionID, long offset, long limit);

  /**
   * 获取全部结果count
   * 
   * @param questionID
   * @return
   */
  long geTotalAnswers(long questionID);

  /**
   * 删除结果
   * 
   * @param answerID
   */
  void deleteAnswer(long answerID);

  /**
   * 添加问题评论信息
   * 
   * @param questionID
   * @param commentContent
   * @return
   */
  QuestionComment addQuestionComment(long questionID, String commentContent);

  /**
   * 添加结果评论信息
   * 
   * @param answerID
   * @param commentContent
   * @return
   */
  AnswerComment addAnswerComment(long answerID, String commentContent);

  /**
   * 删除评论信息
   * 
   * @param commentID
   */
  void deleteComment(long commentID);

  /**
   * 获取问题评论信息
   * 
   * @param questonID
   * @return
   */
  List<QuestionComment> getQuestionComments(long questonID);

  /**
   * 获取答案评论信息
   * 
   * @param answerID
   * @return
   */
  List<AnswerComment> getAnswerComments(long answerID);

}
